<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>vue路由的入门案例</title>
		<script src="../js/vue.js"></script>
		<script src="../js/vue-router.js"></script>
	</head>
	<body>
		<div id="app">
			<h1>实现路由的案例</h1>
			<!-- 定义路由标签 -->
			<router-link to="/home">主页</router-link>
			<!-- 指定路由的填充位，路由展现的位置，固定写法 -->
			<router-view></router-view>
			
		</div>
		<template id="tem">
			<div>
				<h1>我是首页局部组件 </h1>
			</div>
		</template>
		<script>
		let HomeCom = {
			template:"#tem"
		}
		
		const router = new VueRouter({
			routes:[
				{path:"/home",component:HomeCom}
			]
		})
		const app = new Vue({
			el:"#app",
			// router:router k和v的值一样时，可以简写为：
			router
		})
		</script>
	</body>
</html>
